package edu.sctu.zhengsenwen.month201506.day20150601;

/**
 * Created by user15 on 2015/6/2.
 */


/**
 * 进站随身物品处理类
 */
public class Check {

    private String contraband  = "易燃易爆,易腐蚀,管制刀具,有毒物质,枪械";

    private Passengers passengers;

    public Check(Passengers passengers){

        this.passengers = passengers;
    }

    /**
     * 检查包裹
     *
     * @return
     */
    public boolean checkBag(){

        boolean is_contraband = false;

        if(passengers.setBag()){

            if(contraband.contains(passengers.getBagName())){

                is_contraband = true;
            }else{
                is_contraband = false;
            }
        }
        return is_contraband;
    }

    /**
     * 检查水
     * @return
     */
    public boolean checkWater(){

        boolean is_contraband = false;

        if(passengers.setWater()){

            if(contraband.contains(passengers.getWaterName())){

                is_contraband = true;
            }else{
                is_contraband = false;
            }
        }
        return is_contraband;
    }

}
